package com.itheima.springbootsecurity.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @RequestMapping("/hello")
    @PreAuthorize("hasAnyAuthority('/hello')")
    public String hello() {
        return "hello";
    }

    @RequestMapping("/hi")
    @PreAuthorize("hasAnyAuthority('/hi')")
    public String hi() {
        return "hi";
    }
}
